﻿/**
 * @file FITKNastranAdaptorPSHELL.h
 * @author zhourp (zhourunping@diso.cn)
 * @brief the class of adaptor for pshell command
 * @date 2024-11-14
 */
#ifndef FITKNASTRANADAPTORPSHELL_H
#define FITKNASTRANADAPTORPSHELL_H

#include "FITKNastranAbstractAdaptor.h"

#include "FITK_Component/FITKAbaqusData/FITKAbaqusPart.h"
#include "FITK_Component/FITKAbaqusData/FITKDataCase.h"
#include "FITK_Interface/FITKInterfaceModel/FITKComponentManager.h"
#include "FITK_Interface/FITKInterfacePhysics/FITKSectionAssign.h"
#include "FITK_Interface/FITKInterfaceStructural/FITKAbaMaterial.h"
#include "FITK_Interface/FITKInterfaceStructural/FITKAbaMaterialBehavior.h"
#include "FITK_Interface/FITKInterfaceStructural/FITKAbaMaterialDamping.h"
#include "FITK_Interface/FITKInterfaceStructural/FITKAbaMaterialDensity.h"
#include "FITK_Interface/FITKInterfaceStructural/FITKAbaMaterialElastic.h"
#include "FITK_Interface/FITKInterfaceStructural/FITKAbaMaterialExpansion.h"
#include "FITK_Interface/FITKInterfaceStructural/FITKAbaMeshPartVTK.h"
#include "FITK_Interface/FITKInterfaceStructural/FITKAbaSectionBeam.h"
#include "FITK_Interface/FITKInterfaceStructural/FITKAbaSectionShellHomogeneous.h"
#include "FITK_Kernel/FITKAdaptor/FITKIOAdaptorFactory.h"
#include "FITK_Kernel/FITKAppFramework/FITKMessage.h"

#include <QQueue>
#include <QString>

namespace Nastran
{
/**
 * @brief the class of adaptor for pshell command
 * 
 * @author: zhourp (zhourunping@diso.cn)
 * @date: 2024-11-14
 */
class FITKNastranAdaptorPSHELL : public FITKNastranAbstractAdaptor
{
  public:
    explicit FITKNastranAdaptorPSHELL() = default;
    virtual ~FITKNastranAdaptorPSHELL();

    /**
     * @brief 适配器读取
     * @return 状态 true成功， false失败
     * @author zhourp (zhourunping@diso.cn)
     * @date 2024-03-15
     */
    bool adaptR() override;

    /**
     * @brief 适配器写入
     * @return 状态 true成功， false失败
     * @author shenzhuowei (2931275006@qq.com)
     * @date 2025-03-05
     */
    bool adaptW() override;
    /**
     * @brief Assigns case data to the Nastran adapter.
     *
     * This function updates the internal case data for the FITKNastranAdaptorPSHELL
     * class with the provided AbaqusData::FITKDataCase object.
     *
     * @param[in] caseData Pointer to an AbaqusData::FITKDataCase object containing
     *                     the new case data to be set.
     *
     * @author zhourp(zhourunping@diso.cn)
     * @date 2024-11-14
     */
    void setCaseData(AbaqusData::FITKDataCase *caseData);

    /**
     * @brief Set the cache for file content.
     *
     * This function sets the cache for file content using a QQueue of QStrings.
     *
     * @param[in] cache The QQueue containing the file content to be cached.
     * @author zhourp(zhourunping@diso.cn)
     * @date 2024-11-14
     */
    void setFileContentCache(QQueue<QString> cache);

    /**
    * @brief 获取缓存队列
    * @param 缓存队列引用
    * @author shenzhuowei (2931275006@qq.com)
    * @date 2025-03-05
    */
    void getFileContentCache(QQueue<QString>& cache);

  private:
    /**
     * @brief 算例数据
     * @author zhourp (zhourunping@diso.cn)
     * @date 2024-03-15
     */
    AbaqusData::FITKDataCase *_caseData{};

    /**
     * @brief file window cache
     * @author zhourp (zhourunping@diso.cn)
     * @date 2024-03-15
     */
    QQueue<QString> _fileContentCache{};
};

Register2FITKIOAdaptorFactory(BDF, Interface::FITKAbaSectionShellHomogeneous, FITKNastranAdaptorPSHELL)
} // namespace Nastran

#endif // FITKNASTRANADAPTORPSHELL_H
